package top.chenfu.blog.beans;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @Auther chenfu
 * @2019/10/30 14:55
 * @Desc
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class ResponseData {

    private String status;

    private String msg;

    private Object data;

    public static ResponseData defaultSuccess() {
        return new ResponseData("success", "success", null);
    }

    public static ResponseData defaultSuccess(String msg, Object data) {
        return new ResponseData("success", msg, data);
    }

    public static ResponseData defaultSuccess(String msg) {
        return new ResponseData("success", msg, null);
    }

    public static ResponseData defaultFail() {
        return new ResponseData("error", "fail", null);
    }

    public static ResponseData defaultFail(String msg, Object data) {
        return new ResponseData("error", msg, data);
    }

    public static ResponseData defaultFail(String msg) {
        return new ResponseData("error", msg, null);
    }
}
